package cn.mcartoon.dto;

import cn.mcartoon.pojo.MmCartoonComment;
import cn.mcartoon.utils.DateUtils;

import java.text.ParseException;
import java.util.List;

/**
 * @author hys
 * @Description 评论出参数据包装类
 * @date 2019/9/25 13:12
 * Version 1.0
 */
public class CommentDto {
    public String id;
    //主键ID
    private Long commentId;
    //类型   1-->评论漫画；2-->回复评论
    private Integer type;
    //漫画表主键ID
    private Long cartoonId;
    //评论内容
    private String content;
    //评论人用户ID
    private Long userId;
    //昵称
    private String userName;
    //头像
    private String faceUrl;
    //评论添加时间
    private String addTime;
    // 回复评论列表
    private List<ReplyCommentDto> replyList;

    public CommentDto() {
    }
    public CommentDto(MmCartoonComment cc) throws ParseException {
        this.commentId = cc.getCommentId();
        this.type = cc.getCommentType();
        this.cartoonId = cc.getCartoonId();
        this.content = cc.getContent();
        this.userId = cc.getUserId();
        this.addTime = DateUtils.format(cc.getAddTime(), DateUtils.YYYY_MM_DD_HH_MM_SS);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getFaceUrl() {
        return faceUrl;
    }

    public void setFaceUrl(String faceUrl) {
        this.faceUrl = faceUrl;
    }

    public Long getCommentId() {
        return commentId;
    }

    public void setCommentId(Long commentId) {
        this.commentId = commentId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getCartoonId() {
        return cartoonId;
    }

    public void setCartoonId(Long cartoonId) {
        this.cartoonId = cartoonId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getAddTime() {
        return addTime;
    }

    public void setAddTime(String addTime) {
        this.addTime = addTime;
    }

    public List<ReplyCommentDto> getReplyList() {
        return replyList;
    }

    public void setReplyList(List<ReplyCommentDto> replyList) {
        this.replyList = replyList;
    }
}
